/**
 * Copyright notice
 */
package com.gtd.account.user

import com.gtd.IObjectService
import com.gtd.account.*

/**
 * User Service Interface
 *
 * @author  hoatle
 *          hoatlevan at gmail dot com
 * @since   1.0
 * @created Jul 6, 2009
 */
interface IUserService extends IObjectService {
	/**
	 * Check existing user, true when username or email exists
	 * @param u User object
	 * @return true if exists
	 *         false if not
	 * @since  1.0
	 */
	def existed(u)

	/**
	 * Get encrypted password
	 * @param  pwd Password
	 * @return encryptedPwd
	 * @since  1.0
	 */
	 def encryptPassword(pwd)

	/**
	 * Checking user's authentication
	 * @param u User
	 * @return true if authenticated
	 *         false if not
	 * @since  1.0
	 */
	 def authenticate(u)

	/**
	 * Checking user's authorization
	 */
	 def authorize(u, resource)

}